# 数字时钟
import time


class Clock:
    def __init__(self, hour=0, minute=0, second=0):
        self._hour = hour
        self._min = minute
        self._sec = second

    def run(self):
        self._sec += 1
        if self._sec == 60:
            self._sec = 0
            self._min += 1
            if self._min == 60:
                self._min = 0
                self._hour += 1
                if self._hour == 24:
                    self._hour = 0

    def show(self):
        return f'{self._hour}:{self._min}:{self._sec}'


def main():
    clock = Clock(23, 59, 56)
    while True:
        print(clock.show())
        time.sleep(1)
        clock.run()


if __name__ == '__main__':
    main()
